<%inherit file="base.html"/>
<h2>
    ${_('Edit profile')}
</h2>
<div id="mainPanel">
    <div class="section" id="info">
        <h3>
            ${_('Profile')}
            <span class="inlineNav">
                <a href="http://my.hexlabel.net/">^ ${_('Back')}</a>
            </span>
        </h3>
        <p class="intro">${_('All fields other than the name are optional.')}</p>
        <form id="personForm" action="/person/edit" method="post">
            <div class="tip">
                <p>${_('Checkbox marks fields as public (versus friends-only).')}</p>
            </div>
            <dl class="generic">
                <dt><label for="${profile_fields['generic']['name']['values'][0]['id']}">${profile_fields['generic']['name']['meta']['label']}</label></dt>
                <dd class="public">
                    <input type="text" class="text" name="${profile_fields['generic']['name']['values'][0]['id']}" id="${profile_fields['generic']['name']['values'][0]['id']}" value="${profile_fields['generic']['name']['values'][0]['value']}"/>
                </dd>
                <dt><label for="${profile_fields['generic']['about']['values'][0]['id']}">${profile_fields['generic']['about']['meta']['label']}</label></dt>
                <dd>
                    <input type="checkbox" class="checkbox" name="_public_${profile_fields['generic']['about']['values'][0]['id']}" 
                    %if profile_fields['generic']['about']['values'][0]['visibility']:
                        checked="checked"
                    %endif
                    />
                    <textarea class="text" rows="6" cols="20" name="${profile_fields['generic']['about']['values'][0]['id']}" id="${profile_fields['generic']['about']['values'][0]['id']}">${profile_fields['generic']['about']['values'][0]['value']}</textarea>
                </dd>
            </dl>
            <dl class="personal">
                <dt><label for="${profile_fields['personal']['gender']['values'][0]['id']}">${profile_fields['personal']['gender']['meta']['label']}</label></dt>
                <dd>
                    <input type="checkbox" class="checkbox" name="_public_${profile_fields['personal']['gender']['values'][0]['id']}"
                    %if profile_fields['personal']['gender']['values'][0]['visibility']:
                        checked="checked"
                    %endif
                    />
                    <select name="${profile_fields['personal']['gender']['values'][0]['id']}" id="${profile_fields['personal']['gender']['values'][0]['id']}">
                        <option value=""
                        %if profile_fields['personal']['gender']['values'][0]['value'] == '':
                            selected="selected"
                        %endif
                        >${_('Unspecified')}</option>
                        <option value="Male"
                        %if profile_fields['personal']['gender']['values'][0]['value'] == 'Male':
                            selected="selected"
                        %endif
                        >${_('Male')}</option>
                        <option value="Female"
                        %if profile_fields['personal']['gender']['values'][0]['value'] == 'Female':
                            selected="selected"
                        %endif
                        >${_('Female')}</option>
                    </select>
                </dd>
                <dt><label for="${profile_fields['personal']['born']['values'][0]['id']}">${'Year of Birth'}</label></dt>
                <dd>
                    <input type="checkbox" class="checkbox" name="_public_${profile_fields['personal']['born']['values'][0]['id']}"
                    %if profile_fields['personal']['born']['values'][0]['visibility']:
                        checked="checked"
                    %endif
                    />
                    <input type="text" class="text" name="${profile_fields['personal']['born']['values'][0]['id']}" id="${profile_fields['personal']['born']['values'][0]['id']}" value="${profile_fields['personal']['born']['values'][0]['value']}"/>
                </dd>
                <!-- TODO: custom fields? -->
            </dl>
            <dl class="location">
                <dt><label for="${profile_fields['location']['country']['values'][0]['id']}">${profile_fields['location']['country']['meta']['label']}</label></dt>
                <dd>
                    <input type="checkbox" class="checkbox" name="_public_${profile_fields['location']['country']['values'][0]['id']}"
                    %if profile_fields['location']['country']['values'][0]['visibility']:
                        checked="checked"
                    %endif
                    />
                    <input type="text" class="text" name="${profile_fields['location']['country']['values'][0]['id']}" id="${profile_fields['location']['country']['values'][0]['id']}" value="${profile_fields['location']['country']['values'][0]['value']}"/>
                </dd>
                <dt><label for="${profile_fields['location']['region']['values'][0]['id']}">${'Region/State/Province'}</label></dt>
                <dd>
                    <input type="checkbox" class="checkbox" name="_public_${profile_fields['location']['region']['values'][0]['id']}"
                    %if profile_fields['location']['region']['values'][0]['visibility']:
                        checked="checked"
                    %endif
                    />
                    <input type="text" class="text" name="${profile_fields['location']['region']['values'][0]['id']}" id="${profile_fields['location']['region']['values'][0]['id']}" value="${profile_fields['location']['region']['values'][0]['value']}"/>
                </dd>
                <dt><label for="${profile_fields['location']['city']['values'][0]['id']}">${profile_fields['location']['city']['meta']['label']}</label></dt>
                <dd>
                    <input type="checkbox" class="checkbox" name="_public_${profile_fields['location']['city']['values'][0]['id']}"
                    %if profile_fields['location']['city']['values'][0]['visibility']:
                        checked="checked"
                    %endif
                    />
                    <input type="text" class="text" name="${profile_fields['location']['city']['values'][0]['id']}" id="${profile_fields['location']['city']['values'][0]['id']}" value="${profile_fields['location']['city']['values'][0]['value']}"/>
                </dd>


                <!--
                <dt><label for="${profile_fields['location']['lang']['values'][0]['id']}">${profile_fields['location']['lang']['meta']['label']}</label></dt>
                <dd>
                    <input type="checkbox" class="checkbox" name="_public_${profile_fields['location']['lang']['values'][0]['id']}"
                    %if profile_fields['location']['lang']['values'][0]['visibility']:
                        checked="checked"
                    %endif
                    />
                    <select name="${profile_fields['location']['lang']['values'][0]['id']}" id="${profile_fields['location']['lang']['values'][0]['id']}">
                        <option value="en"
                        %if profile_fields['location']['lang']['values'][0]['value'] == '' or profile_fields['location']['lang']['values'][0]['value'] == 'en':
                            selected="selected"
                        %endif
                        >${_('English')}</option>
                        <option value="fi"
                        %if profile_fields['location']['lang']['values'][0]['value'] == 'fi':
                            selected="selected"
                        %endif
                        >${_('Finnish')}</option>
                    </select>
                </dd>
                -->


                <!-- TODO: custom fields? -->
            </dl>
            <dl class="contact">
                <dt><label for="${profile_fields['contact']['email']['values'][0]['id']}">${profile_fields['contact']['email']['meta']['label']}</label></dt>
                <dd>
                    <input type="checkbox" class="checkbox" name="_public_${profile_fields['contact']['email']['values'][0]['id']}"
                    %if profile_fields['contact']['email']['values'][0]['visibility']:
                        checked="checked"
                    %endif
                    />
                    <input type="text" class="text" name="${profile_fields['contact']['email']['values'][0]['id']}" id="${profile_fields['contact']['email']['values'][0]['id']}" value="${profile_fields['contact']['email']['values'][0]['value']}"/>
                </dd>
                <dt><label for="${profile_fields['contact']['website']['values'][0]['id']}">${profile_fields['contact']['website']['meta']['label']}</label></dt>
                <dd>
                    <input type="checkbox" class="checkbox" name="_public_${profile_fields['contact']['website']['values'][0]['id']}"
                    %if profile_fields['contact']['website']['values'][0]['visibility']:
                        checked="checked"
                    %endif
                    />
                    <input type="text" class="text" name="${profile_fields['contact']['website']['values'][0]['id']}" id="${profile_fields['contact']['website']['values'][0]['id']}" value="${profile_fields['contact']['website']['values'][0]['value']}"/>
                </dd>
                <dt><label for="${profile_fields['contact']['phone']['values'][0]['id']}">${profile_fields['contact']['phone']['meta']['label']}</label></dt>
                <dd>
                    <input type="checkbox" class="checkbox" name="_public_${profile_fields['contact']['phone']['values'][0]['id']}"
                    %if profile_fields['contact']['phone']['values'][0]['visibility']:
                        checked="checked"
                    %endif
                    />
                    <input type="text" class="text" name="${profile_fields['contact']['phone']['values'][0]['id']}" id="${profile_fields['contact']['phone']['values'][0]['id']}" value="${profile_fields['contact']['phone']['values'][0]['value']}"/>
                </dd>
                <dt><label for="${profile_fields['contact']['im']['values'][0]['id']}">${profile_fields['contact']['im']['meta']['label']}</label></dt>
                <dd>
                    <input type="checkbox" class="checkbox" name="_public_${profile_fields['contact']['im']['values'][0]['id']}"
                    %if profile_fields['contact']['im']['values'][0]['visibility']:
                        checked="checked"
                    %endif
                    />
                    <input type="text" class="text" name="${profile_fields['contact']['im']['values'][0]['id']}" id="${profile_fields['contact']['im']['values'][0]['id']}" value="${profile_fields['contact']['im']['values'][0]['value']}"/>
                </dd>
                <!-- TODO: custom fields? -->
            </dl>
            <dl>
                <dd class="buttons">
                    <input type="submit" class="submit default" value="${_('Save')}"/>
                </dd>
                <dd class="buttons cancel">
                    <a href="http://my.hexlabel.net/" class="button">${_('Cancel')}</a>
                </dd>
            </dl>
            <div class="clr"><br/></div>
        </form>
    </div>
</div>

<!-- defs -->
<%def name="title()">P2P Fusion - Peerscape | ${profile_fields['generic']['name']['values'][0]['value']} | ${_('Edit profile')}</%def>
<%def name="body_class()">
    % if is_self:
  	    person self dialog
    % else:
  	    person dialog
    % endif
</%def>
